package com.aliyun.messagemgt.repository.mappers;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created with IDEA
 *
 * @author:zhangxingxing 0027012120
 * @date:2019/3/20
 * @time:17:09
 */
public interface ResourceNameMapper {

    /**
     * 根据ID获取资源名称
     *
     * @param nameField
     * @param tblName
     * @param idField
     * @param id
     * @return
     */
    @Select("select ${nameField} from ${tblName} where ${idField} = #{id}")
    String findResourceName(@Param("nameField") String nameField,
                            @Param("tblName") String tblName,
                            @Param("idField") String idField,
                            @Param("id") Integer id);

}
